package com.prs.crm.service.oa.impl;

import java.io.File;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.oa.SynodRecordDao;
import com.prs.crm.domain.oa.SynodRecord;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.SynodRecordService;

public class SynodRecordServiceImpl extends BaseServiceImpl<SynodRecord,SynodRecordDao> implements SynodRecordService{

	@Override
	public void saveSynodRecord(SynodRecord synodRecord, File file,
			String fileName) {
		// TODO Auto-generated method stub
		Attach attach = FileUtil.getInstance().saveFile(file, fileName, "", Constrains.UPLOAD_DIR_SYNOD);
		if(attach.getSrc() != null) {
			synodRecord.setAttach(attach.getSrc());
		}
		this.getDao().save(synodRecord);
	}

}
